<?php

	//$content .= elgg_view('output/longtext', array('value' => $vars['entity']->description));	
	$guid_escuela = $vars['entity']->escuela_guid;
	
	$entity = get_entity($guid_escuela);
	
	$content .= "<h3>Pertenece a la escuela: </h3>";
	$content .= '<h4>' . $entity->title . '</h4>';
	
	$options = array(
    	'relationship' => 'viaPerteneceSector',
    	'relationship_guid' => $vars['entity']->guid,
    	'inverse_relationship' => TRUE
    );
    
    $entities = elgg_get_entities_from_relationship($options);
    
    $titulo = '<h3>Vias del Sector:</h3>';
    foreach ($entities as $entity){
    	$contVias .='<h4>';
    	$contVias .= elgg_view('output/url', array(
			'href' => $entity->getURL(),
			'text' => $entity->title,
		));
		$contVias .='</h4>';
    }
    
	$content .= elgg_view_module('featured', $titulo, $contVias);
	
	$title = '<div style="float: right;">' .
				elgg_view('output/url', array(
					'href' => elgg_get_site_url() . 'action/climbia/deleteSector?guid=' . $vars['entity']->guid,
					'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
					'is_action' => true,
					'is_trusted' => true,
				))
				. '</div>';
				
	$title .= '<div style="float: right; margin: 0px 5px;">' .
				elgg_view('output/url', array(
					'href' => elgg_get_site_url() . 'climbia/addVia?sector_guid=' . $vars['entity']->guid,
					'text' => '<p style="font-size: 70%;">Añadir Via</p>',
					'is_action' => true,
					'is_trusted' => true,
				))
				. '</div>';
				
	$title .= elgg_view_title($vars['entity']->title);
	
	$avatar = elgg_view_entity_icon($vars['entity'] , 'large');
    
    $content = elgg_view_image_block($avatar, $content);
	
	$content = elgg_view_module('info', $title, $content);
	
	echo $content;
	
?>